libxc: osdep: convert xc_evtchn_notify()
authorIan Campbell <ian.campbell@citrix.com>
Fri, 3 Dec 2010 09:36:47 +0000 (09:36 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 3 Dec 2010 09:36:47 +0000 (09:36 +0000)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
tools/libxc/xc_evtchn.c
tools/libxc/xc_linux.c
tools/libxc/xc_minios.c
tools/libxc/xc_netbsd.c
tools/libxc/xc_solaris.c
tools/libxc/xenctrlosdep.h

index 899a9edae0622d6e398bfdc56fa275d44c38644f..ff807e8b5a8d7b2f32aed65b24a4d39065d9b537 100644 (file)
@@ -82,3 +82,18 @@ int xc_evtchn_fd(xc_evtchn *xce)
 {
     return xce->ops->u.evtchn.fd(xce, xce->ops_handle);
 }
+
+int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
+{
+    return xce->ops->u.evtchn.notify(xce, xce->ops_handle, port);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
index d6956ccc85598a7024d4ec963e56bedf77431656..4ad545a07dfd40e121c4661582411b9e222b7bc1 100644 (file)
@@ -365,13 +365,14 @@ static int linux_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
     return (int)h;
 }
 
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
+static int linux_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
 {
+    int fd = (int)h;
     struct ioctl_evtchn_notify notify;
 
     notify.port = port;
 
-    return ioctl(xce->fd, IOCTL_EVTCHN_NOTIFY, &notify);
+    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
 }
 
 evtchn_port_or_error_t
@@ -437,6 +438,7 @@ static struct xc_osdep_ops linux_evtchn_ops = {
 
     .u.evtchn = {
         .fd = &linux_evtchn_fd,
+        .notify = &linux_evtchn_notify,
     },
 };
 
index aeda6eab09012c31d880fdfedef1b734ff134c57..30c2f3b529ef9f331bd38718f1b7cb895578e1ab 100644 (file)
@@ -231,7 +231,7 @@ static int minios_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
     return (int)h;
 }
 
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
+static int minios_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
 {
     int ret;
 
@@ -403,6 +403,7 @@ static struct xc_osdep_ops minios_evtchn_ops = {
 
     .u.evtchn = {
         .fd = &minios_evtchn_fd,
+        .notify = &minios_evtchn_notify,
     },
 };
 
index 2f632fbdb7b3e89fb680db36b1e229ae8e92ef46..5341a274427d800300ffebcd3fa855bdc56ca711 100644 (file)
@@ -215,13 +215,14 @@ static int netbsd_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
     return (int)h;
 }
 
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
+static int netbsd_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
 {
+    int fd = (int)h;
     struct ioctl_evtchn_notify notify;
 
     notify.port = port;
 
-    return ioctl(xce->fd, IOCTL_EVTCHN_NOTIFY, &notify);
+    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
 }
 
 evtchn_port_or_error_t
@@ -301,7 +302,8 @@ static struct xc_osdep_ops netbsd_evtchn_ops = {
     .close = &netbsd_evtchn_close,
 
     .u.evtchn = {
-        .fd = &netbsd_evtchn_fd,
+         .fd = &netbsd_evtchn_fd,
+         .notify = &netbsd_evtchn_notify,
     },
 };
 
index 506319b7ff0f1aafa90b2a28dca0ea66eae29828..edca1871bede667320ebae39fb12a04d8d351b0f 100644 (file)
@@ -207,13 +207,14 @@ static int solaris_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
     return (int)h;
 }
 
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
+static int solaris_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
 {
+    int fd = (int)h;
     struct ioctl_evtchn_notify notify;
 
     notify.port = port;
 
-    return ioctl(xce->fd, IOCTL_EVTCHN_NOTIFY, &notify);
+    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
 }
 
 evtchn_port_or_error_t
@@ -279,6 +280,7 @@ static struct xc_osdep_ops solaris_evtchn_ops = {
 
     .u.evtchn = {
         .fd = &solaris_evtchn_fd,
+        .notify = &solaris_evtchn_notify,
     },
 };
 
index 8607ad8f8027be4f2aaa3cf314a71e654a902b36..6bf2d9ccde4e8b3d9b0f9a9e305c27f1951d0863 100644 (file)
@@ -76,6 +76,8 @@ struct xc_osdep_ops
         } privcmd;
         struct {
             int (*fd)(xc_evtchn *xce, xc_osdep_handle h);
+
+            int (*notify)(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port);
         } evtchn;
     } u;
 };